 <template>
  <div>
    {{count}}
      <button @click="nihao">点击</button>
  </div>
</template>

<script lang="ts" setup>
  import {useMainStore} from '../store'
  import { storeToRefs } from 'pinia';

  const mainStore = useMainStore()

  console.log(mainStore.count);

  const {count} =storeToRefs(mainStore)

  const nihao=()=>{
    mainStore.count++
  }

  

</script>